package com.example.demo.dao.m;

import com.example.demo.entity.m.UserProfile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by xiabin on 2017/7/18.
 */
public interface UserProfilePeopository extends JpaRepository<UserProfile, Long> {
    UserProfile findByUserId(Integer userId);
    UserProfile findByNickname(String nickname);
    UserProfile findByNicknameAndAge(String nickname, Integer age);
    @Query("from UserProfile u where u.nickname=:nickname")
    UserProfile findUserProfile(@Param("nickname") String nickname);
}
